// @ts-ignore
/* eslint-disable */
import request from '@/utils/request'

/** 此处后端没有提供注释 GET /merchantRefunds/${param0} */
export async function getRefundDetail(
  // 叠加生成的Param类型 (非body参数swagger默认没有生成对象)
  params: CartService.getRefundDetailParams,
  options?: { [key: string]: any }
) {
  const { refundId: param0, ...queryParams } = params
  return request<CartService.ResultBizRefundRequest>(`/cart/merchantRefunds/${param0}`, {
    method: 'GET',
    params: { ...queryParams },
    ...(options || {}),
  })
}

/** 此处后端没有提供注释 POST /merchantRefunds/insertRefund */
export async function insertRefund(
  // 叠加生成的Param类型 (非body参数swagger默认没有生成对象)
  params: CartService.insertRefundParams,
  options?: { [key: string]: any }
) {
  return request<any>(`/cart/merchantRefunds/insertRefund`, {
    method: 'POST',
    params: {
      ...params,
      refundRequest: undefined,
      ...params['refundRequest'],
    },
    ...(options || {}),
  })
}

/** 此处后端没有提供注释 GET /merchantRefunds/list */
export async function selectMerchantRefunds(
  // 叠加生成的Param类型 (非body参数swagger默认没有生成对象)
  params: CartService.selectMerchantRefundsParams,
  options?: { [key: string]: any }
) {
  return request<CartService.ResultPageResultBizRefundRequest>(`/cart/merchantRefunds/list`, {
    method: 'GET',
    params: {
      ...params,
      refundRequest: undefined,
      ...params['refundRequest'],
    },
    ...(options || {}),
  })
}

/** 此处后端没有提供注释 POST /merchantRefunds/process */
export async function processRefund(
  body: CartService.BizRefundRequest,
  options?: { [key: string]: any }
) {
  return request<CartService.ResultObject>(`/cart/merchantRefunds/process`, {
    method: 'POST',
    headers: {
      'Content-Type': 'application/json',
    },
    data: body,
    ...(options || {}),
  })
}

/** 此处后端没有提供注释 PUT /merchantRefunds/updateRefund */
export async function updateRefund(
  // 叠加生成的Param类型 (非body参数swagger默认没有生成对象)
  params: CartService.updateRefundParams,
  options?: { [key: string]: any }
) {
  return request<any>(`/cart/merchantRefunds/updateRefund`, {
    method: 'PUT',
    params: {
      ...params,
      refundRequest: undefined,
      ...params['refundRequest'],
    },
    ...(options || {}),
  })
}
